/*
 *  listar_notas_request.cpp
 *  Wilson
 *
 *  Created by Sebastian Orfino on 11/14/11.
 *  Copyright 2011 lbs3. All rights reserved.
 *
 */

#include "VCPlugInHeaders.h"

//sdk include
#include "ILayoutUIUtils.h"
#include "IDocument.h"

//project include
#include "listar_notas_request.h"
#include "listar_notas_response.h"
#include "csxs_facade.h"
#include "xmp_facade.h"


using namespace eventos;



void listar_notas_request::operator()(const csxs::event::Event * const eventParam)
{
	IDocument * frontDoc = Utils<ILayoutUIUtils>()->GetFrontDocument();
	if (!frontDoc) return;
	
	//todo: buscar notas dentro de frontDoc.
	xmp::wilson_metadata wilson_meta(::GetUIDRef(frontDoc)); 		
	listar_notas_response evt;
	evt.notas() = wilson_meta.listar_notas();
	
	wilson::despachar(evt);
}
